#compdef g

_g() {
    local -a options
    local expl

    options=(
        '--bug[report bug]'
        '--duplicate[show duplicate files]:duplicate files:_files'
        '--no-config[do not load config file]'
        '--no-path-transform[disable path transformation]'
        '--[check if there is new release]'
        '--help[show help]'
        '-h[show help]'
        '-?[show help]'
        '--version[print the version]'
        '-v[print the version]'
        '-#[print entry number for each entry]'
        '--csv[output in csv format]'
        '--tsv[output in tsv format]'
        '--byline[print by line]'
        '-1[print by line]'
        '--classic[enable classic mode]'
        '--color[set terminal color mode]:color mode:((always auto never basic 256 24bit))'
        '--colorless[without color]'
        '--depth[limit recursive/tree depth]:depth:'
        '--format[set output format]:format:((across commas horizontal long single-column verbose vertical table markdown csv tsv json tree))'
        '--file-type[do not append indicator to file types]'
        '--md[output in markdown-table format]'
        '--markdown[output in markdown-table format]'
        '--table[output in table format]'
        '--table-style[set table style]:style:((ascii unicode))'
        '--term-width[set screen width]:width:'
        '--theme[apply theme]:path to theme:_files -/'
        '--tree-style[set tree style]:style:((ascii unicode rectangle))'
        '--zero[end each output line with NUL]'
        '-0[end each output line with NUL]'
        '-C[list entries by columns]'
        '-F[append indicator to entries]'
        '-R[recurse into directories]'
        '-T[recursively list in tree]'
        '-d[list directories themselves]'
        '-j[output in json format]'
        '-m[fill width with a comma separated list]'
        '-x[list entries by lines]'
        '--init[show the init script for shell]:shell:((zsh bash fish powershell nushell))'
        '--sort[sort by field]:field:((nature none name Name size Size time Time owner Owner group Group extension Extension inode Inode width Width mime Mime))'
        '--dir-first[list directories before files]'
        '--group-directories-first[list directories before files]'
        '--reverse[reverse the order of the sort]'
        '-r[reverse the order of the sort]'
        '--versionsort[sort by version numbers]'
        '-S[sort by file size]'
        '--si[use powers of 1000 not 1024 for size format]'
        '--sizesort[sort by file size]'
        '-U[do not sort]'
        '--no-sort[do not sort]'
        '-X[sort alphabetically by entry extension]'
        '--sort-by-ext[sort alphabetically by entry extension]'
        '--accessed[accessed time]'
        '--all[show all info/use a long listing format]'
        '--birth[birth time]'
        '--blocks[show block size]'
        '--charset[show charset of text file]'
        '--checksum[show checksum of file]'
        '--checksum-algorithm[checksum algorithm]:algorithm:((md5 sha1 sha224 sha256 sha384 sha512 crc32))'
        '--created[created time]'
        '--dereference[dereference symbolic links]'
        '--footer[add a footer row]'
        '--full-path[show full path]'
        '--full-time[like -all/l --time-style=full-iso]:time-style:((default iso long-iso full-iso +FORMAT))'
        '--flags[list file flags]'
        '--gid[show gid instead of groupname]'
        '--git[show git status]'
        '--git-status[show git status]'
        '--git-repo-branch[list root of git-tree branch]'
        '--branch[list root of git-tree branch]'
        '--git-repo-status[list root of git-tree status]'
        '--repo-status[list root of git-tree status]'
        '--group[show group]'
        '--header[add a header row]'
        '--title[add a header row]'
        '--hyperlink[attach hyperlink to filenames]:mode:((auto always never))'
        '--icon[show icon]'
        '--inode[show inode]'
        '-i[show inode]'
        '--mime[show mime file type]'
        '--mime-parent[show mime parent type]'
        '--modified[modified time]'
        '--mounts[show mount details]'
        '--no-dereference[do not follow symbolic links]'
        '--no-icon[disable icon]'
        '--no-total-size[disable total size]'
        '--numeric[show numeric user and group IDs]'
        '--numeric-uid-gid[show numeric user and group IDs]'
        '--octal-perm[list permission in octal format]'
        '--owner[show owner]'
        '--perm[show permission]'
        '--recursive-size[show recursive size of dir]'
        '--relative-to[show relative path]:path:_files -/'
        '--relative-time[show relative time]'
        '--size[show file/dir size]'
        '--size-unit[set size unit]:unit:((bit "bit" b "byte" k m g t p e z y bb nb auto))'
        '--block-size[set size unit]:unit:((bit "bit" b "byte" k m g t p e z y bb nb auto))'
        '--smart-group[only show group if different from owner]'
        '--statistic[show statistic info]'
        '--stdin[read path from stdin, split by newline]'
        '--time[show time]'
        '--time-style[set time/date format]:format:'
        '--time-type[set time type]:type:((mod "modified" create access all birth))'
        '--total-size[show total size]'
        '--uid[show uid instead of username]'
        '-G[don not print group names in a long listing]'
        '--no-group[don not print group names in a long listing]'
        '-H[list number of hard links for each file]'
        '--link[list number of hard links for each file]'
        '-N[print entry names without quoting]'
        '--literal[print entry names without quoting]'
        '-O[don not print owner names in a long listing]'
        '--no-owner[don not print owner names in a long listing]'
        '-Q[enclose entry names in double quotes]'
        '--quote-name[enclose entry names in double quotes]'
        '-g[like -all, but do not list owner]'
        '-l[use a long listing format]'
        '--long[use a long listing format]'
        '-o[like -all, but do not list group information]'
        '*:filename:_files'
    )

    _arguments -s $options
}

_g