Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

71%
+3 −0
Q&A For scripting what are the pros and cons of command line arguments versus capturing input at the start?

I'm coming down strongly in favor of command-line arguments or options over interactive I/O for a number of reasons: Providing arguments on the command line is vastly superior for programmatic...

posted 1y ago by tripleee‭  ·  edited 1y ago by tripleee‭

Answer
#6: Post edited by user avatar tripleee‭ · 2023-06-23T17:07:02Z (over 1 year ago)
  • I'm coming down strongly in favor of command-line arguments or options over interactive I/O for a number of reasons:
  • * Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).
  • * This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).
  • * This is then also easy to wrap into another API, such as a web front end or a system system service.
  • I'm coming down strongly in favor of command-line arguments or options over interactive I/O for a number of reasons:
  • * Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).
  • * This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).
  • * This is then also easy to wrap into another API, such as a web front end or a system service.
#5: Post edited by user avatar tripleee‭ · 2023-06-23T17:06:37Z (over 1 year ago)
Wording tweak
  • I'm coming down strongly in favor of command-line arguments or options in favor of interactive I/O for a number of reasons:
  • * Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).
  • * This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).
  • * This is then also easy to wrap into another API, such as a web front end or a system system service.
  • I'm coming down strongly in favor of command-line arguments or options over interactive I/O for a number of reasons:
  • * Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).
  • * This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).
  • * This is then also easy to wrap into another API, such as a web front end or a system system service.
#4: Post edited by user avatar tripleee‭ · 2023-06-23T12:15:51Z (over 1 year ago)
Bullet formatting
  • I'm coming down strongly in favor of command-line arguments or options in favor of interactive I/O for a number of reasons:
  • * Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).
  • * This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).
  • * This is then also easy to wrap into another API, such as a web front end or a system system service.
  • I'm coming down strongly in favor of command-line arguments or options in favor of interactive I/O for a number of reasons:
  • * Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).
  • * This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).
  • * This is then also easy to wrap into another API, such as a web front end or a system system service.
#3: Post edited by user avatar tripleee‭ · 2023-06-23T12:14:53Z (over 1 year ago)
Bullet formatting
  • I'm coming down strongly in favor of command-line arguments or options in favor of interactive I/O for a number of reasons:
  • - Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).
  • - This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).
  • - This is then also easy to wrap into another API, such as a web front end or a system system service.
  • I'm coming down strongly in favor of command-line arguments or options in favor of interactive I/O for a number of reasons:
  • * Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).
  • * This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).
  • * This is then also easy to wrap into another API, such as a web front end or a system system service.
#2: Post edited by user avatar tripleee‭ · 2023-06-23T12:14:02Z (over 1 year ago)
Bullet formatting
  • I'm coming down strongly in favor of command-line arguments or options in favor of interactive I/O for a number of reasons:
  • * Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).
  • * This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).
  • * This is then also easy to wrap into another API, such as a web front end or a system system service.
  • I'm coming down strongly in favor of command-line arguments or options in favor of interactive I/O for a number of reasons:
  • - Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).
  • - This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).
  • - This is then also easy to wrap into another API, such as a web front end or a system system service.
#1: Initial revision by user avatar tripleee‭ · 2023-06-23T12:11:57Z (over 1 year ago)
I'm coming down strongly in favor of command-line arguments or options in favor of interactive I/O for a number of reasons:

* Providing arguments on the command line is vastly superior for programmatic invocation (for scripts calling scripts, including but not limited to the tool's own test suite, other scripts calling your script, etc).

* This makes it easy for the command-line user, too, as they can easily recall and repeat or edit previous invocations using their shell's history mechanism, as well as features like command-line completion to avoid having to type in long and potentially complex file names by hand (or long option names, if you have them; though then your tool probably needs to also supply a small completion configuration for each shell you want to support).

* This is then also easy to wrap into another API, such as a web front end or a system system service.