You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this useful package. I'd like to pass arguments to docopt for which the name have not explicitly defined (becauuse they are dynamic). In R, we know the concept of an ellipse (...). I imagine it to work similar to this:
./inst/bin/style-files --style_pkg=1 --stle_fun=3 --key=1 --value2=67 f1 f2
But I get an error.
Error: style files.
Usage:
style_files [--style_pkg=<style_guide_pkg>] [--style_fun=<style_guide_fun>] <files>...
Options:
--style_pkg=<style_guide_pkg> Package where the style guide is stored [default: styler].
--style_fun=<style_guide_fun> The styling functionin style_pkg [default: tidyverse_style].
Execution halted
Is there any way to do this? Or can you maybe expose the parser so I can parse the arguments without matching them to the docs?
Here is my script:
#!/usr/bin/env Rscript
'style files.
Usage:
style_files [--style_pkg=<style_guide_pkg>] [--style_fun=<style_guide_fun>] <files>...
Options:
--style_pkg=<style_guide_pkg> Package where the style guide is stored [default: styler].
--style_fun=<style_guide_fun> The styling function in style_pkg [default: tidyverse_style].
' -> doc
saveRDS(commandArgs(), 'cmd.rds')
I note that ... matches unnamed arguments here, but I'd like to pass named ones.
The text was updated successfully, but these errors were encountered:
lorenzwalthert
changed the title
passing ... through docopt
passing named ... through docopt
Sep 16, 2020
Thanks for this useful package. I'd like to pass arguments to docopt for which the name have not explicitly defined (becauuse they are dynamic). In R, we know the concept of an ellipse (
...
). I imagine it to work similar to this:But I get an error.
Is there any way to do this? Or can you maybe expose the parser so I can parse the arguments without matching them to the docs?
Here is my script:
I note that ... matches unnamed arguments here, but I'd like to pass named ones.
The text was updated successfully, but these errors were encountered: