Comments (5)
Seems a reasonable thing to do - only question is what should the comment syntax be? Can you find any other similar args files that use comments? I'd prefer to copy rather than do something different.
from cmdargs.
Hi! Thanks a lot for the feedback. I'm coming from the viewpoint of parsing the arguments for ledger-style argument files, also used in hledger.
Ledger supports the following characters for comments: https://www.ledger-cli.org/3.0/doc/ledger3.html#Commenting-on-your-Journal
Naturally, I would not expect cmdargs to follow ledger's specs but some of those are common comment chars, like #
and ;
. Perhaps others, too, but I'm mostly using these two. That might be a good start?
Edit: Technically, arguments start with --
or /
or a letter [A-z][a-z] or a number [0-9]? So, in theory, any other special character might a comment. But that would be too restrictive.
from cmdargs.
Count me interested too. The recent https://www.stevegattuso.me/tech-stack/finances-budgeting.html#args has some nice examples of args files commented with #, but I'm not sure this actually works - it doesn't for me.
The only docs I have found for the argument file format are at https://stackoverflow.com/questions/53995002/where-does-shell-argument-files-or-files-originate-from .
from cmdargs.
The recent https://www.stevegattuso.me/tech-stack/finances-budgeting.html#args has some nice examples of args files commented with #, but I'm not sure this actually works - it doesn't for me.
Presumably this was just an annotated example and the #
comments aren't actually part of the files
from cmdargs.
The implementation is here: https://github.com/ndmitchell/cmdargs/blob/master/System/Console/CmdArgs/Explicit/ExpandArgsAt.hs#L7
Ignoring lines beginning with # or whitespace and # would be easy. Correctly ignoring end-of-line # comments is harder, it would be nice not to break quoted arguments containing #. Or you could ignore shell quoting rules, as I suspect java does (https://docs.oracle.com/javase/9/tools/java.htm#JSWOR-GUID-4856361B-8BFD-4964-AE84-121F5F6CF111 : Use the number sign # in the argument file to identify comments. All characters following the# are ignored until the end of line.)
from cmdargs.
Related Issues (20)
- Does not print help message for all options with the same help message in multiple modes HOT 2
- expandArgsAt doesn't understand ~ HOT 1
- modeHelp eats blank lines HOT 1
- Generate help text if no default mode was specified HOT 2
- Wondering how to make a required argument. HOT 4
- A problem with common flags and multiple typFile resulting in "ITEM" HOT 4
- sudo-like cli: a way to instruct `cmdargs` to not look for flags in the remaining arguments HOT 2
- man and info generation
- Using `&= help` with `&= argPos` throws an error HOT 1
- Default Lists?
- Running multiple sub-commands HOT 1
- Inconsistency in handling boolean arguments HOT 1
- Way to use multiple modes without partial record field selectors? HOT 2
- Tighter bounds base for old cmdargs HOT 1
- Is it possible to create arguments with only a single dash? HOT 1
- hidden arguments? HOT 6
- splitArgs: document quoting rules
- How can I customize --numeric-version? HOT 13
- Incorrect handling of subcommands with the same argument 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 cmdargs.