Skip to main content
-1 votes
2 answers
71 views

I am writing a script to interact with a GitHub environment. For certain use cases, I need to limit my script's scope to a list of users, which I store in a newline-delimited file. I want to pass the ...
DoctorMarmalade's user avatar
1 vote
0 answers
23 views

I am currently creating a launcher (launcher.py) in Python 2.7 which can be used from GUI and terminal input. The launcher combines already eisting Software, that has its own GUI and its own terminal ...
pummeluff25's user avatar
0 votes
1 answer
67 views

I have type Month = Int parseMonths :: OP.Parser (Month, Month) parseMonths = liftA2 (,) (OP.option (OP.eitherReader $ parseNumber "month" (\n -> 1&...
Lemming's user avatar
  • 597
1 vote
1 answer
1k views

I'm trying to add a new option to an already working C program using getopt_long. The option I want to add is -S but every time I try to run the code I get: ./HidCom: invalid option --'S' I simply ...
Vincenzo Cristiano's user avatar
0 votes
1 answer
61 views

I am building a CLI gem with Ruby and I'm using OptionParser to add flags with arguments. Whenever one flag is called with an argument a function get's called. I have three flags. My problem is, when ...
problems's user avatar
  • 115
0 votes
1 answer
98 views

Env: python3.7 OptionParser with a option [ add_option('-t', '--target', action='append', dest='targets') ] OS: CentOS7.6 Problem: So I am using this option to input a list of targets, and ...
Snart's user avatar
  • 84
1 vote
1 answer
366 views

Now when I type " python openweather.py --api=key --city=London --temp=fahrenheit " in command prompt, I get the desired output of temperature in fahrenheit or even if celcius is entered (" --temp=...
Junaid's user avatar
  • 63
1 vote
1 answer
209 views

There are two python scripts, 'script1.py' and 'script2.py'. 'script1.py' uses OptionParser to parse command line arguments. The contents of 'script1.py' look something like this from optparse ...
shy_am's user avatar
  • 13
7 votes
2 answers
4k views

I am using Ruby's OptionParser (require 'optparse') processing a "verbose" option that can be either true or false. It is in the code like this: parser.on('-v', '--[no-]verbose', 'Verbose mode') do ...
Keith Bennett's user avatar
1 vote
1 answer
345 views

I started paying around with Crystal lang, I want to use OptionParser to show a help text, however -h will be interpred by Crystal instead of OptionParser I am using the example from https://crystal-...
Snake Sanders's user avatar
0 votes
2 answers
618 views

main |--> src |--> custom_calculation.py |--> test_custom_calculation.py custom_calculation.py def calc_total(a,b): return a+b def calc_multiply(a,b): return a*b ...
StackGuru's user avatar
  • 503
3 votes
2 answers
2k views

Here is a stripped down version of OptionParser OptionParser.new do |opts| opts.on('-f', '--format FORMAT', 'output format (text, html, yml, json, xml)') do |format| options['format'...
TIMBERings's user avatar
1 vote
1 answer
678 views

I have a simple python (v2.7) script (test.py) #!/usr/bin/python import sys from optparse import OptionParser def main(): parser = OptionParser() parser.add_option("--files", dest="files", ...
leas's user avatar
  • 301
2 votes
2 answers
845 views

How do I unit test my script for incorrect command line arguments? For example, my_script.py -t should give an error since -t flag is not present, as shown in the code below: parser = ...
Steve 's user avatar
  • 101
1 vote
0 answers
35 views

I'm trying to figure out how to define subparameters for one of my parameters. This is what I have that is NOT working: require 'optparse' options = {} OptionParser.new do |parser| parser.on("-r",...
ed_is_my_name's user avatar

15 30 50 per page
1
2 3 4 5
7