Comments (3)
A related requirement would be the possibility of specifying some, but not all, options as interactive, e.g. password options and the like. This is common in database command line clients where most options are specified on the command line, but the password is prompted for interactively. Thus, it would make sense to separate between masked (.readPassword System/console)
and unmasked (read-line)
input.
Edit: Thank you for putting together this very useful library. It is really appreciated!
from cli-matic.
I was thinking of making some options "completable", that is, if missing, they would be asked for interactively. What do you think?
from cli-matic.
That sounds like it would satisfy my requirement quite nicely! So long as it only tries asking for them if a tty is present. Otherwise it would cause weird behavior when running the app in daemon mode.
I just about mucked about implementing support for interactive options in a fork (ps not quite complete or tested): snorremd@4293ea2
Line 163 in the parse-cmds-with-defaults
function tripped me up as I can't understand how it would return anything other than the full list of environment options though.
The set-keys-in
value is a clojure map with keywords -> option maps.
Whereas each map in the env-options
vector is a cli-matic option map.
So when looking up the keyword in the cli-matic option map, it would return nil a falsy value, and then complement it returning true. E.g.:
(filter (complement #{:foo :bar}) [{:option "foo"} {:option "bar"}])
=> ({:option "foo"} {:option "bar"})
So that might be a bug?
Thanks again.
from cli-matic.
Related Issues (20)
- example not executing as documented. HOT 1
- Do not dump stack trace on mistyped subcommand HOT 3
- [Ftr] dd sysexit codes
- Return value from `(doall ...)` causes `getReturnValue` to throw
- clj -m raises warning
- [Ftr] Flag to not run System/Exit HOT 5
- :default values for :jsonfile options do not parse files
- [Ftr] Babashka: avoid external bb.edn file HOT 2
- Glob multiple position arguments
- Update all dependencies but CLJ
- [Ftr] Snappier scripts with tiered compilation
- :multiple does not work with :default HOT 4
- [Ftr] Support repetition for flags ? e.g. ansible style verbose: -v / -vv / -vvv HOT 1
- [Ftr] Generate a basic UI for calling the application based on cli-matic configuration HOT 1
- [Ftr] Ability to extend type presets, like `:file` for conforming the arg to `File`
- [Ftr] Ability to *disable* -? gloabl help HOT 1
- cli-matic can enable global spec instrumentation under inappropriate circumstances HOT 2
- Returning lazy sequences from :runs throws - IPending is not IDeref HOT 1
- Update tools.cli to 1.0.219 HOT 1
- Remove contributors from README HOT 1
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 cli-matic.