Ver código fonte

improved backward compatibility.

naelstrof 7 anos atrás
pai
commit
e87468bacf
5 arquivos alterados com 18 adições e 4 exclusões
  1. 1
    1
      CMakeLists.txt
  2. 1
    1
      slop.1
  3. BIN
      slop.1.gz
  4. 11
    1
      src/main.cpp
  5. 5
    1
      src/options.cpp

+ 1
- 1
CMakeLists.txt Ver arquivo

@@ -21,7 +21,7 @@ endif()
21 21
 
22 22
 include_directories("${PROJECT_BINARY_DIR}")
23 23
 
24
-add_definitions(-DSLOP_VERSION="v5.3.27")
24
+add_definitions(-DSLOP_VERSION="v5.3.28")
25 25
 
26 26
 # The names have to be unique unfortunately.
27 27
 set(EXECUTABLE_NAME "slop")

+ 1
- 1
slop.1 Ver arquivo

@@ -37,7 +37,7 @@ This sets the vertex shader, and fragment shader combo to use when drawing the f
37 37
 Sets the output format for slop. Format specifiers are %x, %y, %w, %h, %i, and %g. If actual percentage signs are desired in output, use a double percentage sign like so `%%`.
38 38
 .TP
39 39
 .BR \-n ", " \-\-nodecorations=INT
40
-Sets the level of aggressiveness when trying to remove window decroations. `0' is off, `1' will try lightly to remove decorations, and `2' will recursively descend into the root tree until it gets the deepest available visible child under the mouse. Defaults to `0'.
40
+Sets the level of aggressiveness when trying to remove window decroations. `0' is off, `1' will try lightly to remove decorations, and `2' will recursively descend into the root tree until it gets the deepest available visible child under the mouse. Defaults to `0'. Supplying slop with just `-n` is equivalent to supplying `-n1`.
41 41
 .TP
42 42
 .BR \-l ", " \-\-highlight
43 43
 Instead of outlining a selection, slop will highlight it instead. This is particularly useful if the color is set to an opacity lower than 1.

BIN
slop.1.gz Ver arquivo


+ 11
- 1
src/main.cpp Ver arquivo

@@ -41,7 +41,15 @@ SlopOptions* getOptions( Options& options ) {
41 41
     foo->b = color.b;
42 42
     foo->a = color.a;
43 43
     options.getBool("highlight", 'l', foo->highlight);
44
-    options.getInt("nodecorations", 'n', foo->nodecorations);
44
+    try {
45
+        bool test = false;
46
+        options.getBool("nodecorations", 'n', test);
47
+        if ( test ) {
48
+            foo->nodecorations = 1;
49
+        }
50
+    } catch( ... ) {
51
+        options.getInt("nodecorations", 'n', foo->nodecorations);
52
+    }
45 53
     return foo;
46 54
 }
47 55
 
@@ -116,6 +124,8 @@ void printHelp() {
116 124
     std::cout << "                                  1 will enable a light attempt to\n";
117 125
     std::cout << "                                  remove decorations. Setting this to 2 will\n";
118 126
     std::cout << "                                  enable aggressive decoration removal.\n";
127
+    std::cout << "                                  Supplying slop with just `-n` is\n";
128
+    std::cout << "                                  equivalent to supplying `-n1`.\n";
119 129
     std::cout << "                                  (default=`0')\n";
120 130
 	std::cout << "  -q, --quiet                   Disable any unnecessary cerr output. Any\n";
121 131
 	std::cout << "                                  warnings simply won't print.\n";

+ 5
- 1
src/options.cpp Ver arquivo

@@ -78,7 +78,11 @@ int Options::parseCharOption( int argc, char** argv, int argumentIndex, int vali
78 78
     arguments.push_back( std::string()+argument[1] );
79 79
     // If they supplied the parameters with spaces
80 80
     if ( argument == std::string()+"-"+check.cname ) {
81
-        values.push_back(argv[argumentIndex+1]);
81
+        if ( argumentIndex+1 < argc ) {
82
+            values.push_back(argv[argumentIndex+1]);
83
+        } else {
84
+            values.push_back("");
85
+        }
82 86
         return 2;
83 87
     }
84 88
     // If they didn't supply the parameters with spaces