Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Accessing CLI Arguments #86

Open
mertyildiran opened this issue Dec 17, 2020 · 0 comments
Open

[RFC] Accessing CLI Arguments #86

mertyildiran opened this issue Dec 17, 2020 · 0 comments
Assignees
Labels
feature request New feature or request
Projects

Comments

@mertyildiran
Copy link
Member

Implement the args core library and provide the necessary C extension API in the language's source to access command-line arguments from Chaos C extensions.

For a command like this:

chaos dev.kaos arg1 arg2 -s 'short value' --long 'long value'

the library provide these functionality:

import args

print args.count() # Should print 7
print args.index(0) # Should print 'dev.kaos'
print args.index(1) # Should print 'arg1'
print args.index(2) # Should print 'arg2'
print args.index(3) # Should print '-s'
print args.index(4) # Should print 'short value'
print args.index(5) # Should print '--long'
print args.index(6) # Should print 'long value'

print args.file() # Should print 'dev.kaos'
print args.short('s') # Should print 'short value'
print args.long('long') # Should print 'long value'
@mertyildiran mertyildiran added the feature request New feature or request label Dec 17, 2020
@mertyildiran mertyildiran added this to To do in Chaos via automation Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
Chaos
  
To do
Development

No branches or pull requests

2 participants