Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 1 | #include "cache.h" |
Junio C Hamano | 8502357 | 2006-12-19 14:34:12 -0800 | [diff] [blame] | 2 | #include "wt-status.h" |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 3 | |
| 4 | extern int wt_status_use_color; |
| 5 | |
| 6 | static const char runstatus_usage[] = |
Rene Scharfe | fd93141 | 2006-11-18 15:15:49 +0100 | [diff] [blame] | 7 | "git-runstatus [--color|--nocolor] [--amend] [--verbose] [--untracked]"; |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 8 | |
| 9 | int cmd_runstatus(int argc, const char **argv, const char *prefix) |
| 10 | { |
| 11 | struct wt_status s; |
| 12 | int i; |
| 13 | |
| 14 | git_config(git_status_config); |
| 15 | wt_status_prepare(&s); |
| 16 | |
| 17 | for (i = 1; i < argc; i++) { |
| 18 | if (!strcmp(argv[i], "--color")) |
| 19 | wt_status_use_color = 1; |
| 20 | else if (!strcmp(argv[i], "--nocolor")) |
| 21 | wt_status_use_color = 0; |
| 22 | else if (!strcmp(argv[i], "--amend")) { |
| 23 | s.amend = 1; |
| 24 | s.reference = "HEAD^1"; |
| 25 | } |
| 26 | else if (!strcmp(argv[i], "--verbose")) |
| 27 | s.verbose = 1; |
Johannes Schindelin | 2074cb0 | 2006-09-12 22:45:12 +0200 | [diff] [blame] | 28 | else if (!strcmp(argv[i], "--untracked")) |
| 29 | s.untracked = 1; |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 30 | else |
| 31 | usage(runstatus_usage); |
| 32 | } |
| 33 | |
| 34 | wt_status_print(&s); |
| 35 | return s.commitable ? 0 : 1; |
| 36 | } |