]> thyrsus.com Git - src.git/commitdiff
First command working.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 6 Nov 2014 16:27:22 +0000 (11:27 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 6 Nov 2014 16:27:22 +0000 (11:27 -0500)
src [new file with mode: 0755]

diff --git a/src b/src
new file mode 100755 (executable)
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:])