Commit 00b3ab4
man page for birdfont and parsing of command line parameters
Changed files (9)
modifiedNEWSmodifiedbirdfont.shaddedlinux/birdfont.1modifiedsrc/Argument.valamodifiedsrc/GtkWindow.valamodifiedsrc/Main.valamodifiedsrc/MainWindow.valamodifiedsrc/MenuTab.valamodifiedsrc/Supplement.vala
Diff
@@ -3,7 +3,7 @@ birdfont (0.5) stable; * Move multiple control points * Draw path from both ends * New edit commands-+ * Man pages -- Johan Mattsson <johan.mattsson.m@gmail.com> Sat Oct 20 19:52:27 CEST 2012 birdfont (0.4.1) stable;@@ -1,4 +1,4 @@ export LD_LIBRARY_PATH="./build/src/:$LD_LIBRARY_PATH" PKG_PATH=$(dirname "$(readlink -f "$0")") cd "${PKG_PATH}"-./build/src/birdfont+./build/src/birdfont $*new file mode 100644@@ -0,0 +1,31 @@+.TH BIRDFONT 1 LOCAL++.SH NAME+birdfont - font editor+.SH SYNOPSIS+.B birdfont [file] [options]+.SH DESCRIPTION+birdfont lets you edit and create font files.++See http://birdfont.org+.SH OPTIONS+.TP+-c, --show-coordinates+show coordinate in glyph view+.TP+-e, --exit+exit if a testcase failes+.TP+-f, --fatal-warning+treat warnings as fatal+.TP+-h, --help+show command line options+.TP+-s, --slow+sleep between each command in test suite+.TP+-t [testcase]+run tests+.SH AUTHOR+Johan Mattsson@@ -17,7 +17,7 @@ namespace Supplement { -class Argument : GLib.Object {+public class Argument : GLib.Object { List<string> args; @@ -60,7 +60,7 @@ class Argument : GLib.Object { } // valid parameter- if (a == "--autosave" || a == "--exit" || a == "--slow" || a == "--help" || a == "--test" || a == "--fatal-warning" || a == "--show-coordinates") {+ if (a == "--exit" || a == "--slow" || a == "--help" || a == "--test" || a == "--fatal-warning" || a == "--show-coordinates") { prev = a; i++; continue;@@ -166,7 +166,7 @@ class Argument : GLib.Object { stdout.printf ("\n"); } - /** Return full command line parameter for an abbrevation.+ /** Return full command line parameter for the abbrevation. * -t becomes --test. */ private string expand_param (string? param) {@@ -178,18 +178,16 @@ class Argument : GLib.Object { if (p.char_count () != 2) return ""; switch (p.get_char (1)) {- case 'a': - return "--autosave"; case 'c': return "--show-coordinates"; case 'e': return "--exit"; case 'f': return "--fatal-warning";- case 's': - return "--slow"; case 'h': return "--help";+ case 's': + return "--slow"; case 't': return "--test"; }@@ -228,12 +226,12 @@ class Argument : GLib.Object { stdout.printf (args.nth (0).data); stdout.printf (" [FILE] [OPTION ...]\n"); + print_padded ("-c, --show-coordinates", "show coordinate in glyph view"); print_padded ("-e, --exit", "exit if a testcase failes"); print_padded ("-f, --fatal-warning", "treat warnings as fatal"); print_padded ("-h, --help", "show this message"); print_padded ("-s, --slow", "sleep between each command in test suite"); print_padded ("-t, --test [TEST]", "run test case");- print_padded ("-c --show-coordinates", "show coordinate in glyph view"); stdout.printf ("\n"); }@@ -152,7 +152,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { return false; }); - MainWindow.tabs.add_unique_tab (MainWindow.content, 60, true);+ MainWindow.tabs.add_unique_tab (MainWindow.menu_tab, 60, true); MainWindow.tabs.select_tab_name ("Menu"); @@ -21,7 +21,7 @@ using Supplement; public static int main (string[] arg) { GtkWindow native_window; MainWindow window;- + string file; Supplement.Supplement supplement = new Supplement.Supplement (); supplement.init (arg); @@ -31,6 +31,11 @@ public static int main (string[] arg) { window.set_native (native_window); native_window.init ();++ file = supplement.args.get_file ();+ if (file != "") {+ window.menu_tab.load_font (file);+ } Gtk.main (); @@ -23,7 +23,7 @@ public class MainWindow { public static GlyphCanvas glyph_canvas; public static MainWindow singleton; public static KeyBindings key_bindings; - public static MenuTab content; + public static MenuTab menu_tab; public static TooltipArea tool_tip; public static OverView over_view; public static TabBar tabs; @@ -36,7 +36,7 @@ public class MainWindow { glyph_canvas = new GlyphCanvas (); tools = new Toolbox (glyph_canvas); tabs = new TabBar (); - content = new MenuTab (); + menu_tab = new MenuTab (); tool_tip = new TooltipArea (); over_view = new OverView(); } @@ -116,11 +116,11 @@ public class MainWindow { } internal static MenuTab get_content_display () { - if (unlikely ((MenuTab?) get_singleton ().content == null)) { + if (unlikely ((MenuTab?) get_singleton ().menu_tab == null)) { warning ("MenuTab not instantiated."); } - return get_singleton ().content; + return get_singleton ().menu_tab; } public static MainWindow get_singleton () { @@ -207,7 +207,7 @@ c.append (""" recent_fonts.reverse (); } - private void load_font (string fn) {+ public void load_font (string fn) { Font font = Supplement.get_current_font (); SaveDialog save = new SaveDialog ();@@ -21,7 +21,7 @@ using Birdfont; namespace Supplement { public class Supplement { - internal static Argument args; + public static Argument args; internal static bool experimental = false; internal static bool show_coordinates = false; internal static bool fatal_wanings = false;