Comments (6)
In this case, the terminator (i.e. --
) would be treated as a positional argument that happens to be composed of two dashes. IOW, your request is not consistent with GNU or POSIX CLI standards, so Argbash won't implement this.
Argbash will happily allow you to declare the infinitely long positional argument with an appropriate help message, but there are no means how to shape the help command-line synopsis to the form that you would like to.
As the feature requested is non-standard, I close this issue, but I hope that you will still find Argbash useful for more conventional tasks.
from argbash.
Hi, I think the standalone double dash is a GNU standard, as you see it many applications, most prominantly grep,
Some details here, https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean/11382#11382
Also directly in bash:
https://linux.die.net/man/1/bash
A -- signals the end of options and disables further option processing. Any arguments after the -- are treated as filenames and arguments. An argument of - is equivalent to --.
from argbash.
Seems its also in the POSIX standard:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_02
Guideline 10:
The first -- argument that is not an option-argument should be accepted as a delimiter indicating the end of options. Any following arguments should be treated as operands, even if they begin with the '-' character.
from argbash.
You are right that --
aka terminator is standardized, but I think that the usage that you suggest would be non standard. Terminator is there to indicate that there won't be any optional arguments following it, and everything ends up being treated as positional argument, even if it looks like an option.
What I understand that you suggest is to somehow separate two sets of positional arguments, as the first set doesn't have a fixed length. Terminator as defined in the standard is not there for these purposes. My earlier comment about terminator being treated as a positional argument was misleading, so you can forget about it.
from argbash.
Maybe I'm reading the usage docs differently, from bash:
A -- signals the end of options and disables further option processing. Any arguments after the -- are treated as filenames and arguments. An argument of - is equivalent to --.
This is exactly what I want to happen in argbash. Everything after --
should end up in ARG_LEFTOVERS. I just want to make this division explicit.
from argbash.
This pairs up with ARG_RESTRICT_VALUES as I'd like to check for validity everything before --
as being valid and allow anything after --
to end up in LEFTOVERS.
from argbash.
Related Issues (20)
- autom4te Error: invalid command code m, end of file in string: syntax error in expression HOT 1
- ARG_LEFTOVERS functionality dependent on bash version HOT 1
- Invalid short and long options are treated as positional arguments HOT 2
- evaluate_strictness make the script fail if executed with errexit HOT 1
- feature request: add possibility to add code before the argbash definitions HOT 2
- make compatible with errexit and nounset HOT 1
- Fluent API like commands HOT 2
- SSL Certificate does't match argbash.io HOT 2
- Project description: add https://argbash.dev
- Clarify license implication of using argbash
- Show example usage in the readme (hello world example)
- PKGBUILD.in missing dependency rst2man for generating manpages HOT 3
- Calculate default value at run time?
- parse_commandline: _key should be local?
- Perform argbash arg parsing for bash functions HOT 1
- Feature Request: GIT style commands with arguments HOT 1
- Hardcoded bash path? HOT 1
- Feature Request: Argbash clean command/output type
- Online generator still uses release 2.9.0 with generated code pointing to argbash.io
- argbash.dev is down HOT 2
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 argbash.