aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-24 09:44:38 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-24 09:44:38 +0100
commit85e9259035a9df477a68f722592c0f10413b6c53 (patch)
tree7e5623f325aff3bfb1060449e6f1ab8309d1c685 /src
parentm (diff)
downloadsat-85e9259035a9df477a68f722592c0f10413b6c53.tar.gz
sat-85e9259035a9df477a68f722592c0f10413b6c53.tar.bz2
sat-85e9259035a9df477a68f722592c0f10413b6c53.tar.xz
satd: command line
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/satd.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/satd.c b/src/satd.c
index 2d2c2f8..4534ae4 100644
--- a/src/satd.c
+++ b/src/satd.c
@@ -19,12 +19,46 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+/**
+ * The name of the process.
+ */
+char *argv0 = "satr";
+
+
+
+/**
+ * Print usage information.
+ */
+static void
+usage(void)
+{
+ fprintf(stderr, "usage: [-f] %s\n",
+ strrchr(argv0) ? (strrchr(argv0) + 1) : argv0);
+ exit(2);
+}
+
+
int
main(int argc, char *argv[])
{
+ int foreground = 0;
+
+ if (argc > 0)
+ argv0 = argv[0];
+ if (argc > 2)
+ usage();
+ if (argc == 2) {
+ if (strcmp(argv[1], "-f"))
+ usage();
+ foreground = 1;
+ }
+
/* TODO guess what, this is going to be the daemon */
}