From a99276b64434efb746137765fccc13737fc48d24 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 6 Nov 2014 11:27:22 -0500 Subject: [PATCH] First command working. --- src | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 src diff --git a/src b/src new file mode 100755 index 0000000..6ac8ca3 --- /dev/null +++ b/src @@ -0,0 +1,44 @@ +#!/usr/bin/env python2 +# +# src - simple revision control. +# +import sys + +version = 0.1 + +def help(*args): + print""" +src help [command] + Displays help for commands. + +src init:: + Creates a .src directory if none already exists + +src add ['file'...] + Initialize new project histories for specified files. + +src commit ['revison-spec'] ['file'...] + Enters a commit for specified files. Separately to each one. + +src branch [delete] ['branchname'] + Create, switch to, or delete a branch. With no arguments, list branches. + +src tag [delete] ['tagname'] ['revspec'] + Create, switch to, or delete a tag. With no arguments, list tags. + +src log ['revision-spec'] ['file'...] + Sends log information about the specified files to standard output. + +src diff ['revision-spec'] ['file'...] + Sends a diff listing to standard output + +src fast-export ['file'...] + Export one or more projects as a git fast-import stream. +""" + +if __name__ == "__main__": + command = sys.argv[1:] + if not command: + help() + else: + eval(command[0])(*command[1:]) -- 2.43.0