Explorar el Código

improved backward compatibility.

naelstrof hace 7 años
padre
commit
e87468bacf
Se han modificado 5 ficheros con 18 adiciones y 4 borrados
  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 fichero

21
 
21
 
22
 include_directories("${PROJECT_BINARY_DIR}")
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
 # The names have to be unique unfortunately.
26
 # The names have to be unique unfortunately.
27
 set(EXECUTABLE_NAME "slop")
27
 set(EXECUTABLE_NAME "slop")

+ 1
- 1
slop.1 Ver fichero

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 `%%`.
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
 .TP
38
 .TP
39
 .BR \-n ", " \-\-nodecorations=INT
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
 .TP
41
 .TP
42
 .BR \-l ", " \-\-highlight
42
 .BR \-l ", " \-\-highlight
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.
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 fichero


+ 11
- 1
src/main.cpp Ver fichero

41
     foo->b = color.b;
41
     foo->b = color.b;
42
     foo->a = color.a;
42
     foo->a = color.a;
43
     options.getBool("highlight", 'l', foo->highlight);
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
     return foo;
53
     return foo;
46
 }
54
 }
47
 
55
 
116
     std::cout << "                                  1 will enable a light attempt to\n";
124
     std::cout << "                                  1 will enable a light attempt to\n";
117
     std::cout << "                                  remove decorations. Setting this to 2 will\n";
125
     std::cout << "                                  remove decorations. Setting this to 2 will\n";
118
     std::cout << "                                  enable aggressive decoration removal.\n";
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
     std::cout << "                                  (default=`0')\n";
129
     std::cout << "                                  (default=`0')\n";
120
 	std::cout << "  -q, --quiet                   Disable any unnecessary cerr output. Any\n";
130
 	std::cout << "  -q, --quiet                   Disable any unnecessary cerr output. Any\n";
121
 	std::cout << "                                  warnings simply won't print.\n";
131
 	std::cout << "                                  warnings simply won't print.\n";

+ 5
- 1
src/options.cpp Ver fichero

78
     arguments.push_back( std::string()+argument[1] );
78
     arguments.push_back( std::string()+argument[1] );
79
     // If they supplied the parameters with spaces
79
     // If they supplied the parameters with spaces
80
     if ( argument == std::string()+"-"+check.cname ) {
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
         return 2;
86
         return 2;
83
     }
87
     }
84
     // If they didn't supply the parameters with spaces
88
     // If they didn't supply the parameters with spaces