aboutsummaryrefslogtreecommitdiff
path: root/util/fbrun/main.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-10-04 21:01:31 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-10-04 21:01:31 (GMT)
commite6570b61f34e9d7822f500706a5a2cd6bc436234 (patch)
tree3f186315662e41fc8908d07a1720de0282113981 /util/fbrun/main.cc
parent4b5c00b764417b91388d6e88b10f3cbd2764ff02 (diff)
downloadfluxbox-e6570b61f34e9d7822f500706a5a2cd6bc436234.zip
fluxbox-e6570b61f34e9d7822f500706a5a2cd6bc436234.tar.bz2
add -print option to fbrun to return result to stdout instead of executing it
Diffstat (limited to 'util/fbrun/main.cc')
-rw-r--r--util/fbrun/main.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/fbrun/main.cc b/util/fbrun/main.cc
index 6adfbe7..f9875d3 100644
--- a/util/fbrun/main.cc
+++ b/util/fbrun/main.cc
@@ -55,6 +55,7 @@ void showUsage(const char *progname) {
55 " -font [font name] Text font"<<endl<< 55 " -font [font name] Text font"<<endl<<
56 " -title [title name] Set title"<<endl<< 56 " -title [title name] Set title"<<endl<<
57 " -text [text] Text input"<<endl<< 57 " -text [text] Text input"<<endl<<
58 " -print Print result to stdout"<<endl<<
58 " -w [width] Window width in pixels"<<endl<< 59 " -w [width] Window width in pixels"<<endl<<
59 " -h [height] Window height in pixels"<<endl<< 60 " -h [height] Window height in pixels"<<endl<<
60 " -display [display string] Display name"<<endl<< 61 " -display [display string] Display name"<<endl<<
@@ -75,6 +76,7 @@ int main(int argc, char **argv) {
75 bool set_pos = false; // set position 76 bool set_pos = false; // set position
76 bool near_mouse = false; // popup near mouse 77 bool near_mouse = false; // popup near mouse
77 bool antialias = true; // antialias text 78 bool antialias = true; // antialias text
79 bool print = false;
78 string fontname; // font name 80 string fontname; // font name
79 string title("Run program"); // default title 81 string title("Run program"); // default title
80 string text; // default input text 82 string text; // default input text
@@ -86,6 +88,8 @@ int main(int argc, char **argv) {
86 for (int i=1; i<argc; i++) { 88 for (int i=1; i<argc; i++) {
87 if (strcmp(argv[i], "-font") == 0 && i+1 < argc) { 89 if (strcmp(argv[i], "-font") == 0 && i+1 < argc) {
88 fontname = argv[++i]; 90 fontname = argv[++i];
91 } else if (strcmp(argv[i], "-print") == 0) {
92 print = true;
89 } else if (strcmp(argv[i], "-title") == 0 && i+1 < argc) { 93 } else if (strcmp(argv[i], "-title") == 0 && i+1 < argc) {
90 title = argv[++i]; 94 title = argv[++i];
91 } else if (strcmp(argv[i], "-text") == 0 && i+1 < argc) { 95 } else if (strcmp(argv[i], "-text") == 0 && i+1 < argc) {
@@ -129,7 +133,7 @@ int main(int argc, char **argv) {
129 FbTk::App application(display_name.c_str()); 133 FbTk::App application(display_name.c_str());
130 FbRun fbrun; 134 FbRun fbrun;
131 135
132 //fbrun.setAntialias(antialias); 136 fbrun.setPrint(print);
133 137
134 if (fontname.size() != 0) { 138 if (fontname.size() != 0) {
135 if (!fbrun.loadFont(fontname.c_str())) { 139 if (!fbrun.loadFont(fontname.c_str())) {