Comments (4)
You can pass in your own Command Invoker here. With this, you shouldn't have to clone a lot of the code.
Also, support for validators was added in #21.
Closing but let me know if there is still are large block of code you have to clone just for a small change.
from knack.
If you run any commands that return a list, you'll get
{
"currentPage": [],
"nextLink": ""
}
You have to subclass CommandInvoker and largely clone this logic in order to make it work with lists. It would be better to have some kind of hook method that could be passed in or at least overwritten in the subclass in order to provide this handling without having to duplicate the core logic.
from knack.
Actually, you can't even subclass the Invoker. I had to monkey patch over it.
from knack.
Additionally, the Knack invoker has no support for validators, so I need to monkey patch the CommandInvoker.execute method to reintroduce this functionality.
from knack.
Related Issues (20)
- interest in passing functions, not strings for commands? HOT 1
- Best practice to read configuration values from whithin commands? HOT 1
- What is client_factory?
- util.todict process DefaultInt to a dictionary instead of a int HOT 1
- CLICommandsLoader.create_command overrides the argument "arguments_loader" HOT 3
- Release candidate tags are sorted as higher than actual releases (0.8.0rc2 >> 0.8.0) HOT 7
- TSV output doesn't include headers
- Misleading error message for invalid choice arguments
- Knack error when I run azdev linter
- How to disable default Global Arguments (especially -o)?
- When json value has null, knack in Azure CLI changes column order unintentionally. HOT 1
- Colorama is not being installed in Windows even though it is required
- I think Knack is pulling a version of PyYAML that has a known vulnerability. HOT 10
- Config file value ignored by command validation code HOT 1
- This repo is missing important files
- Set column width for tabular output format HOT 1
- Remove / move `ensure_dir` call since it might cause some issues and not consistent HOT 5
- `extract_full_summary_from_signature` uses undocumented `Match.regs`
- Inefficient regex in `extract_full_summary_from_signature`
- knack/knack /prompting.py _prompt_bool never taking default action
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knack.