Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common options should be consistent among programs #3

Open
fanfani opened this issue Jan 30, 2025 · 2 comments
Open

common options should be consistent among programs #3

fanfani opened this issue Jan 30, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@fanfani
Copy link

fanfani commented Jan 30, 2025

common options should be consistent among programs.

for instance, user defined width and height are sometimes invoked with -w -H and other with -W -H switches

it would be nice to invoke them always with the same syntax :-)

  • random_pixels
Usage: ./random_pixels [options]

Options:
  -h            Show this help message
  -w WIDTH      Window width (default: 1280)
  -H HEIGHT     Window height (default: 720)
  -r ROWS       Number of rows (default: 16)
  -c COLS       Number of columns (default: 22)

  • text
Usage: ./text [-c cols] [-r rows] [-s speed] [-t text] [-f fontsize] [-T textcolor] [-G gridcolor] [-B bgcolor] [-W width] [-H height] [-d direction]
Colors should be in R,G,B format (e.g., 255,0,0)
Direction: 0=horizontal (default), 1=vertical

@fanfani fanfani added the enhancement New feature or request label Jan 30, 2025
@biappi biappi mentioned this issue Feb 9, 2025
@biappi
Copy link
Member

biappi commented Feb 9, 2025

@fanfani I've "glued up" the three designs programs we had in a single executable, so most options should be common, and it should be possible to change designs on the fly and do the horizontal flip with the keyboard.

willy@Hitagi pixelwall main$ ./pixelwall -h
The MIAI pixelwall
Usage: ./pixelwall [options]
Options:
  -d <design>      Set design (default: snake)
  -B <color>       Set background color (R,G,B, default: 0,0,0)
  -O <color>       Set border color (R,G,B, default: 130,130,130)
  -r <rows>        Set number of rows (default: 16)
  -c <cols>        Set number of columns (default: 22)
  -w <width>       Set window width (default: 1276)
  -H <height>      Set window height (default: 928)
  -F               Flip horizontally
  -f <rate>        Set frame rate (default: 10)
  -i <interval>    Set move interval in seconds (default: 0.2)
  -b <size>        Set border size (default: 2)
  -h               Show this help message

Design: snake
  -W <color>       Set worm color (R,G,B, default: 0,228,48)
  -l <length>      Set initial worm length (default: 5)
  -m <length>      Set maximum worm length (default: 100)

Design: random-pixels
  -I <squares>     Initial active squares (default: 10)
  -m <ticks>       Maximum random ticks (default: 100)

Design: text
  -t <text>        Set text (default: text)
  -f <font size>   Set font size (default: 14)
  -T <color>       Set text color (R,G,B default: 255,255,255)
  -d <direction>   Set initial direction (0: horizontal, 1: vertical default: 0)

willy@Hitagi pixelwall main$ 

not sure if all the options combination works, but this is a first step into making some order in all things

@fanfani
Copy link
Author

fanfani commented Feb 16, 2025

some options are conflicting, for instance:

-f

general option:

-f <rate> Set frame rate (default: 10)

conflicts with text design option:

-f <font size> Set font size (default: 14)

-O

general option:

-O <color> Set border color (R,G,B, default: 0,0,0)

conflicts with cm5 design option:

-O <color> On color (R,G,B, default: 200,10,5)

-d

general option:

-d <design> Set design (default: snake)

conflicts with text, cm5, text-arcade options:

-d <direction> Set initial direction (0: horizontal, 1: vertical default: 0)

i would suggest using some convention for handling general and specific options. for instance, we could have uppercase options for general and lowercase for design-specific switches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants