From 56ce557708c8387dc0fae590f10e4db62d409fa5 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 23 Apr 2015 20:35:31 -0700 Subject: 1151 --- cpp/001help | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cpp/001help') diff --git a/cpp/001help b/cpp/001help index c3ce7874..18d7efa6 100644 --- a/cpp/001help +++ b/cpp/001help @@ -1,3 +1,6 @@ +//: Everything this project/binary supports. +//: This should give you a sense for what to look forward to in later layers. + :(before "End Commandline Parsing") if (argc <= 1 || is_equal(argv[1], "--help")) { // this is the functionality later layers will provide @@ -12,6 +15,15 @@ if (argc <= 1 || is_equal(argv[1], "--help")) { return 0; } +//:: Helper function used by the above fragment of code (and later layers too, +//:: who knows?). +//: The :(code) directive appends function definitions to the end of the +//: project. Regardless of where functions are defined, we can call them +//: anywhere we like as long as we format the function header in a specific +//: way: put it all on a single line without indent, end the line with ') {' +//: and no trailing whitespace. As long as functions uniformly start this +//: way, our makefile contains a little command to automatically generate +//: declarations for them. :(code) bool is_equal(char* s, const char* lit) { return strncmp(s, lit, strlen(lit)) == 0; -- cgit 1.4.1-2-gfad0 kspecs/ranger/commit/README?h=v1.9.3&id=4f3b6f023603ec2cefcb9703856b6598fe515e3b'>commit diff stats
path: root/README
blob: 4525d94c35aac49b89e918507ddff4ded34c3735 (plain) (tree)
1
2
3
4
5
6
7
8
9