Closed Adnanhashim closed 1 year ago
In this particular case setting nargs = "?"
should do what you want (don't trigger an {argparse}
ERROR if -f1
or -f2
is missing a file):
parser$add_argument("-f1", "--file1", dest = "file1", nargs = "?")
parser$add_argument("-f2", "--file2", dest = "file2", nargs = "?")
I have following R script
When I use Rscript test1.R (without any command line argument), I get output from my customised help_message()
But when I use Rscript test1.R -h, I get default help function output
If I use Rscript test1.R -f1, I get following output
I want to get output from customised help_message in all the cases.