GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — libgit2/src/cli at main · libgit2/libgit2

Expand file tree

/

cli

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

cli

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
unix
unix
 
 
win32
win32
 
 
CMakeLists.txt
CMakeLists.txt
 
 
README.md
README.md
 
 
cmd.c
cmd.c
 
 
cmd.h
cmd.h
 
 
cmd_blame.c
cmd_blame.c
 
 
cmd_cat_file.c
cmd_cat_file.c
 
 
cmd_clone.c
cmd_clone.c
 
 
cmd_commit.c
cmd_commit.c
 
 
cmd_config.c
cmd_config.c
 
 
cmd_hash_object.c
cmd_hash_object.c
 
 
cmd_help.c
cmd_help.c
 
 
cmd_index_pack.c
cmd_index_pack.c
 
 
cmd_init.c
cmd_init.c
 
 
cmd_version.c
cmd_version.c
 
 
common.c
common.c
 
 
common.h
common.h
 
 
error.h
error.h
 
 
main.c
main.c
 
 
opt.c
opt.c
 
 
opt.h
opt.h
 
 
opt_usage.c
opt_usage.c
 
 
opt_usage.h
opt_usage.h
 
 
progress.c
progress.c
 
 
progress.h
progress.h
 
 
sighandler.h
sighandler.h
 
 

README.md

Outline

cli

A git-compatible command-line interface that uses libgit2.

Adding commands

  1. Individual commands have a main-like top-level entrypoint. For example:

    int cmd_help(int argc, char **argv)

    Although this is the same signature as main, commands are not built as individual standalone executables, they'll be linked into the main cli. (Though there may be an option for command executables to be built as standalone executables in the future.)

  2. Commands are prototyped in cmd.h and added to main.c's list of commands (cli_cmds[]). Commands should be specified with their name, entrypoint and a brief description that can be printed in git help. This is done because commands are linked into the main cli.

  3. Commands should accept a --help option that displays their help information. This will be shown when a user runs <command> --help and when a user runs help <command>.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.