2006-09-08 10:05:34 +02:00
|
|
|
#include "cache.h"
|
2006-12-19 23:34:12 +01:00
|
|
|
#include "wt-status.h"
|
2006-09-08 10:05:34 +02:00
|
|
|
|
|
|
|
extern int wt_status_use_color;
|
|
|
|
|
|
|
|
static const char runstatus_usage[] =
|
2006-11-18 15:15:49 +01:00
|
|
|
"git-runstatus [--color|--nocolor] [--amend] [--verbose] [--untracked]";
|
2006-09-08 10:05:34 +02:00
|
|
|
|
|
|
|
int cmd_runstatus(int argc, const char **argv, const char *prefix)
|
|
|
|
{
|
|
|
|
struct wt_status s;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
git_config(git_status_config);
|
|
|
|
wt_status_prepare(&s);
|
|
|
|
|
|
|
|
for (i = 1; i < argc; i++) {
|
|
|
|
if (!strcmp(argv[i], "--color"))
|
|
|
|
wt_status_use_color = 1;
|
|
|
|
else if (!strcmp(argv[i], "--nocolor"))
|
|
|
|
wt_status_use_color = 0;
|
|
|
|
else if (!strcmp(argv[i], "--amend")) {
|
|
|
|
s.amend = 1;
|
|
|
|
s.reference = "HEAD^1";
|
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "--verbose"))
|
|
|
|
s.verbose = 1;
|
2006-09-12 22:45:12 +02:00
|
|
|
else if (!strcmp(argv[i], "--untracked"))
|
|
|
|
s.untracked = 1;
|
2006-09-08 10:05:34 +02:00
|
|
|
else
|
|
|
|
usage(runstatus_usage);
|
|
|
|
}
|
|
|
|
|
|
|
|
wt_status_print(&s);
|
|
|
|
return s.commitable ? 0 : 1;
|
|
|
|
}
|