gbdev / rgbds

Rednex Game Boy Development System - An assembly toolchain for the Nintendo Game Boy and Game Boy Color
https://rgbds.gbdev.io
MIT License
1.35k stars 172 forks source link

`rgbgfx -c` doesn't allow spaces between switch and argument (except in @ files) #1057

Closed SuperDisk closed 2 years ago

SuperDisk commented 2 years ago
npfaro@NICKSLAPTOP:/mnt/c/Projects/GB-Stuff/rgbds$ rgbgfx -o asdf.2bpp -c#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF testimg.png
npfaro@NICKSLAPTOP:/mnt/c/Projects/GB-Stuff/rgbds$ rgbgfx -o asdf.2bpp -c #FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF testimg.png
rgbgfx: option requires an argument: c
Usage: rgbgfx [-r stride] [-CmuVZ] [-v [-v ...]] [-a <attr_map> | -A]
       [-b <base_ids>] [-c <colors>] [-d <depth>] [-L <slice>] [-N <nb_tiles>]
       [-n <nb_pals>] [-o <out_file>] [-p <pal_file> | -P] [-q <pal_map> | -Q]
       [-s <nb_colors>] [-t <tile_map> | -T] [-x <nb_tiles>] <file>
Useful options:
    -m, --mirror-tiles    optimize out mirrored tiles
    -o, --output <path>   output the tile data to this path
    -t, --tilemap <path>  output the tile map to this path
    -u, --unique-tiles    optimize out identical tiles
    -V, --version         print RGBGFX version and exit

For help, use `man rgbgfx' or go to https://rgbds.gbdev.io/docs/
npfaro@NICKSLAPTOP:/mnt/c/Projects/GB-Stuff/rgbds$

When in @-files though, the space works.

SuperDisk commented 2 years ago

NVM I'm just stupid, # is a comment in bash.

Rangi42 commented 2 years ago

Yeah, rgbgfx -o asdf.2bpp -c '#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF' testimg.png works.

ISSOtm commented 2 years ago

Comments are usually disabled in interactive shells, though: https://www.gnu.org/software/bash/manual/bash.html#Comments

Rangi42 commented 2 years ago

Apparently not in Cygwin's default config:

$ echo red is #ff0000
red is
SuperDisk commented 2 years ago

An interactive shell without the interactive_comments option enabled does not allow comments. The interactive_comments option is on by default in interactive shells.

According the link. So it looks like comments are indeed enabled by default in interactive shells.