Skip to content

Commit 303edb9

Browse files
committed
Fastfetch: add option --faction-trailing-zeros
1 parent 37ab380 commit 303edb9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/data/help.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,18 @@
846846
"default": -1
847847
}
848848
},
849+
{
850+
"long": "fraction-trailing-zeros",
851+
"desc": "Set when to keep trailing zeros",
852+
"arg": {
853+
"type": "enum",
854+
"enum": {
855+
"default": "Use the behavior defined internally",
856+
"always": "Always keep trailing zeros",
857+
"never": "Never keep trailing zeros"
858+
}
859+
}
860+
},
849861
{
850862
"long": "temp-unit",
851863
"desc": "Set the temperature unit",

src/options/display.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,15 @@ bool ffOptionsParseDisplayCommandLine(FFOptionsDisplay* options, const char* key
711711
}
712712
else if(ffStrEqualsIgnCase(key, "--fraction-ndigits"))
713713
options->fractionNdigits = (int8_t) ffOptionParseInt32(key, value);
714+
else if(ffStrEqualsIgnCase(key, "--fraction-trailing-zeros"))
715+
{
716+
options->fractionTrailingZeros = (FFFractionTrailingZerosType) ffOptionParseEnum(key, value, (FFKeyValuePair[]) {
717+
{ "default", FF_FRACTION_TRAILING_ZEROS_TYPE_DEFAULT },
718+
{ "show", FF_FRACTION_TRAILING_ZEROS_TYPE_SHOW },
719+
{ "hide", FF_FRACTION_TRAILING_ZEROS_TYPE_HIDE },
720+
{},
721+
});
722+
}
714723
else if(ffStrEqualsIgnCase(key, "--no-buffer"))
715724
options->noBuffer = ffOptionParseBoolean(value);
716725
else if(ffStrStartsWithIgnCase(key, "--bar-"))

0 commit comments

Comments
 (0)