Giter VIP home page Giter VIP logo

Comments (6)

matejak avatar matejak commented on September 25, 2024

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.

gdevenyi avatar gdevenyi commented on September 25, 2024

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.

gdevenyi avatar gdevenyi commented on September 25, 2024

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.

matejak avatar matejak commented on September 25, 2024

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.

gdevenyi avatar gdevenyi commented on September 25, 2024

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.

gdevenyi avatar gdevenyi commented on September 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.