Author Topic: [Fixed] Inconsistent CLI argument format  (Read 845 times)

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
[Fixed] Inconsistent CLI argument format
« on: 16 April 2011, 02:56:43 »
To make the game show the CLI usage, you need to invoke
Code: [Select]
glestadv --help
This, on the other hand, will not display the usage:
Code: [Select]
glestadv -help
Instead, this results in this output:
Code: [Select]
unknown argument: -help
All the other CLI arguments use a single dash format, though, as the usage shows:
Code: [Select]
glestadv --help
usage: ./build/source/game/glestadv [options]
  -server                  startup and immediately host a game
  -client IP               startup and immediately connect to server IP
  -configdir path          set location of configs and logs to path
  -datadir path            set location of data
  -loadmap map tileset     load maps/map.gbm with tilesets/tileset for map preview
  -scenario category name  load immediately scenario/category/name

Trying to invoke GAE with a double-dashed variant of these options again results in (for example):
Code: [Select]
unknown argument: --client
GAE should either accept only single or only double-dashes CLI arguments, or both, but not require single-dashes arguments in some and double-dashed arguments in other cases (unless a getopts-like difference of single vs. multiple character arguments is made).
« Last Edit: 18 April 2011, 17:07:56 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Inconsistent CLI argument format
« Reply #1 on: 16 April 2011, 05:10:48 »
Proposal: Have *both* single and double dashes work. Thus "--help" and "-help" would be the same thing.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Inconsistent CLI argument format
« Reply #2 on: 16 April 2011, 14:03:17 »
Both it is.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

 

anything