Skip to content

gstatus missing argument in timestamp calculations #14

Description

@jens-hj

On MacOS there seems to be a weird issue with gstatus where it prints the output fine until stashes: whereafter it complains about a missing argument which seems to have something to do with timestamp calculations.

Image

The full output is:

math: Error: Too few arguments
'1739231450 - '
             ^
test: Missing argument at index 3
-gt 0
      ^
~/.config/fish/functions/gstatus.fish (line 275):
            if test $time_since -gt $longest_time_since
               ^
in function 'gstatus'
~/.config/fish/functions/gstatus.fish (line 1): array indices start at 1, not 0.
math "$now - $timestamps[$i]"
                          ^
in command substitution
        called on line 273 of file ~/.config/fish/functions/gstatus.fish
in function 'gstatus'
~/.config/fish/functions/gstatus.fish (line 273): Expansion error
            set -l time_since (math "$now - $timestamps[$i]")
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
in function 'gstatus'
test: Missing argument at index 3
-gt 0
      ^
~/.config/fish/functions/gstatus.fish (line 275):
            if test $time_since -gt $longest_time_since
               ^
in function 'gstatus'
string pad: -w: option requires an argument
    []
~/.config/fish/functions/gstatus.fish (line 1): array indices start at 1, not 0.
string pad -w $index_width $indices[$i]
                                     ^
in command substitution
        called on line 285 of file ~/.config/fish/functions/gstatus.fish
in function 'gstatus'
~/.config/fish/functions/gstatus.fish (line 287): Expansion error
                $cyan (string pad -w $index_width $indices[$i]) $reset \
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
in function 'gstatus'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions