-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from bouncepaw/0.10
0.10
- Loading branch information
Showing
32 changed files
with
1,121 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"log" | ||
"path/filepath" | ||
|
||
"github.com/bouncepaw/mycorrhiza/util" | ||
) | ||
|
||
func init() { | ||
flag.StringVar(&util.ServerPort, "port", "1737", "Port to serve the wiki at") | ||
flag.StringVar(&util.HomePage, "home", "home", "The home page") | ||
flag.StringVar(&util.SiteTitle, "title", "🍄", "How to call your wiki in the navititle") | ||
} | ||
|
||
// Do the things related to cli args and die maybe | ||
func parseCliArgs() { | ||
flag.Parse() | ||
|
||
args := flag.Args() | ||
if len(args) == 0 { | ||
log.Fatal("Error: pass a wiki directory") | ||
} | ||
|
||
var err error | ||
WikiDir, err = filepath.Abs(args[0]) | ||
util.WikiDir = WikiDir | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
if !isCanonicalName(util.HomePage) { | ||
log.Fatal("Error: you must use a proper name for the homepage") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.