Skip to content

Commit 8ca8c57

Browse files
authored
Merge pull request #170 from end2endzone/feature-issue110
Merge feature-issue110
2 parents 96253fd + 0023f3b commit 8ca8c57

25 files changed

+890
-0
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
Changes for 0.10.0
22

3+
* Shellanything now features verbose logging mode and command line arguments debugging tools.
34
* Fixed issue #6 : (twice) Right-click on a directory with Windows Explorer in the left panel shows the menus twice.
45
* Fixed issue #31 : (twice) Error in logs for CContextMenu::GetCommandString()
56
* Fixed issue #109: Implement default and verbose logging.
7+
* Fixed issue #110: Create a simple command line arguments debugging application.
68
* Fixed issue #150: ico icon (that do not specifically force index=0) are not working.
79
* Fixed issue #157: Compilation fails on Github Action: `fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory`.
810
* Fixed issue #158: Compilation fails on Github Action: `CPack error : Problem running WiX.`.

UserManual.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ This manual includes a description of the system functionalities and capabilitie
4747
* [Fixed properties](#fixed-properties)
4848
* [Default properties](#default-properties)
4949
* [Environment variables](#environment-variables)
50+
* [Tools](#tools)
51+
* [file_explorer_renew](#file_explorer_renew)
52+
* [arguments.debugger](#argumentsdebugger)
5053
* [Plugins](#plugins)
5154
* [Plugin overview](#plugin-overview)
5255
* [C API](#c-api)
@@ -74,6 +77,7 @@ This manual includes a description of the system functionalities and capabilitie
7477
* [Keyboard mnemonics](#mnemonics--keyboard-shortcuts)
7578
* [Troubleshooting](#troubleshooting)
7679
* [Logging support](#logging-support)
80+
* [Checkout the _Tools_ section](#tools)
7781
* [Missing ampersand character (`&`) in menus](#missing-ampersand-character--in-menus)
7882
* [Reporting bugs](#reporting-bugs)
7983

@@ -1796,6 +1800,79 @@ The following table defines the list of pre-defined environment variables for Sh
17961800

17971801

17981802

1803+
# Tools #
1804+
1805+
1806+
## file_explorer_renew ##
1807+
1808+
**file_explorer_renew** is an utility provided with ShellAnything that can close and reopen all File Explorer windows.
1809+
1810+
Shell Extension DLLs cannot be easily deleted because _File Explorer_ usually have a lock on the file. File Explorer Renew is used to force File Explorer to release file locks on shell extentions such as ShellAnything.
1811+
1812+
The utility is useful during the [uninstall process](https://github.com/end2endzone/ShellAnything/blob/master/INSTALL.md#uninstall). For more details, see the [uninstall section of INSTALL.md](https://github.com/end2endzone/ShellAnything/blob/master/INSTALL.md#uninstall).
1813+
1814+
1815+
1816+
## arguments.debugger ##
1817+
1818+
**arguments debugger** is a set of two applications for debugging command line arguments sent to a program. When launched, they display individual arguments that started their process.
1819+
1820+
There are two applications `arguments.debugger.console.exe` and `arguments.debugger.window.exe`. The first is a console application, the second is a windows application. Both applications will show the individual command line arguments received from [<exec> action](#exec-action).
1821+
1822+
This tool allows one to validate that he properly escaped string values to use as command line parameters. Test your <exec> actions with _arguments.debugger_ until all your arguments are ready. Then switch your actions to launch your actual programs.
1823+
1824+
For example, if you execute the following menu action:
1825+
```xml
1826+
<menu name="arguments.debugger">
1827+
<actions>
1828+
<exec
1829+
path="${application.directory}\arguments.debugger.window.exe"
1830+
arguments="This is &quot;multiple arguments at once&quot; including &quot;utf-8 characters&quot; such as the Greek alphabet Αα Ββ Γγ Δδ Εε Ζζ Ηη Θθ Ιι Κκ Λλ Μμ Νν Ξξ Οο Ππ Ρρ Σσ/ς Ττ Υυ Φφ Χχ Ψψ Ωω."
1831+
/>
1832+
</actions>
1833+
</menu>
1834+
```
1835+
arguments.debugger.window.exe will starts and show the following arguments:
1836+
```
1837+
argc=35
1838+
1839+
argv[0]=C:\Program Files\ShellAnything\bin\arguments.debugger.window.exe
1840+
argv[1]=This
1841+
argv[2]=is
1842+
argv[3]=multiple arguments at once
1843+
argv[4]=including
1844+
argv[5]=utf-8 characters
1845+
argv[6]=such
1846+
argv[7]=as
1847+
argv[8]=the
1848+
argv[9]=Greek
1849+
argv[10]=alphabet
1850+
argv[11]=Αα
1851+
argv[12]=Ββ
1852+
argv[13]=Γγ
1853+
argv[14]=Δδ
1854+
argv[15]=Εε
1855+
argv[16]=Ζζ
1856+
argv[17]=Ηη
1857+
argv[18]=Θθ
1858+
argv[19]=Ιι
1859+
argv[20]=Κκ
1860+
argv[21]=Λλ
1861+
argv[22]=Μμ
1862+
argv[23]=Νν
1863+
argv[24]=Ξξ
1864+
argv[25]=Οο
1865+
argv[26]=Ππ
1866+
argv[27]=Ρρ
1867+
argv[28]=Σσ/ς
1868+
argv[29]=Ττ
1869+
argv[30]=Υυ
1870+
argv[31]=Φφ
1871+
argv[32]=Χχ
1872+
argv[33]=Ψψ
1873+
argv[34]=Ωω.
1874+
```
1875+
17991876
# Plugins #
18001877

18011878

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ add_subdirectory(api)
3939
add_subdirectory(logger/glog)
4040
add_subdirectory(windows)
4141
add_subdirectory(file_explorer_renew)
42+
add_subdirectory(arguments.debugger.console)
43+
add_subdirectory(arguments.debugger.window)
4244

4345
if(SHELLANYTHING_BUILD_PLUGINS)
4446
add_subdirectory(plugins/sa_plugin_process)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
find_package(rapidassist REQUIRED)
2+
3+
set(REFRESH_DEBUG_ARGS_CON_RESOURCE_FILES ""
4+
resource.h
5+
showargs.ico
6+
showargs.rc
7+
)
8+
9+
add_executable(arguments.debugger.console
10+
${SHELLANYTHING_EXPORT_HEADER}
11+
${SHELLANYTHING_VERSION_HEADER}
12+
${SHELLANYTHING_CONFIG_HEADER}
13+
${REFRESH_DEBUG_ARGS_CON_RESOURCE_FILES}
14+
../arguments.debugger.window/arguments.cpp
15+
../arguments.debugger.window/arguments.h
16+
framework.h
17+
main.cpp
18+
targetver.h
19+
)
20+
21+
# Group external files as filter for Visual Studio
22+
source_group("Resource Files" FILES ${REFRESH_DEBUG_ARGS_CON_RESOURCE_FILES})
23+
24+
# Force UNICODE for target
25+
target_compile_definitions(arguments.debugger.console PRIVATE -D_UNICODE -DUNICODE)
26+
27+
# Force CMAKE_DEBUG_POSTFIX for executables
28+
set_target_properties(arguments.debugger.console PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
29+
30+
# Define include directories for the executable.
31+
target_include_directories(arguments.debugger.console
32+
PRIVATE
33+
${GTEST_INCLUDE_DIR}
34+
rapidassist
35+
${CMAKE_SOURCE_DIR}/src/shared
36+
)
37+
38+
# Define linking dependencies.
39+
add_dependencies(arguments.debugger.console sa.shared)
40+
target_link_libraries(arguments.debugger.console
41+
PRIVATE
42+
sa.shared
43+
rapidassist
44+
)
45+
46+
install(TARGETS arguments.debugger.console
47+
EXPORT shellanything-targets
48+
ARCHIVE DESTINATION ${SHELLANYTHING_INSTALL_LIB_DIR}
49+
LIBRARY DESTINATION ${SHELLANYTHING_INSTALL_LIB_DIR}
50+
RUNTIME DESTINATION ${SHELLANYTHING_INSTALL_BIN_DIR}
51+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// header.h : include file for standard system include files,
2+
// or project specific include files
3+
//
4+
5+
#pragma once
6+
7+
#include "targetver.h"
8+
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
9+
// Windows Header Files
10+
#include <windows.h>
11+
// C RunTime Header Files
12+
#include <stdlib.h>
13+
#include <malloc.h>
14+
#include <memory.h>
15+
#include <tchar.h>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#include <iostream>
2+
#include <io.h>
3+
#include <fcntl.h>
4+
#include <string>
5+
#include "framework.h"
6+
#include "../arguments.debugger.window/arguments.h"
7+
8+
#include "rapidassist/console.h"
9+
10+
11+
// Debug arguments example:
12+
// This is "multiple arguments at once" including "utf-8 characters" such as the Greek alphabet Αα Ββ Γγ Δδ Εε Ζζ Ηη Θθ Ιι Κκ Λλ Μμ Νν Ξξ Οο Ππ Ρρ Σσ/ς Ττ Υυ Φφ Χχ Ψψ Ωω.
13+
14+
15+
// https://stackoverflow.com/questions/33836706/what-are-tchar-strings-and-the-a-or-w-version-of-win32-api-functions
16+
17+
#if defined(UNICODE)
18+
std::wistream& tcin = std::wcin;
19+
std::wostream& tcout = std::wcout;
20+
#else
21+
std::istream& tcin = std::cin;
22+
std::ostream& tcout = std::cout;
23+
#endif
24+
25+
int _tmain(int argc, _TCHAR* argv[])
26+
{
27+
_setmode(_fileno(stdout), _O_U16TEXT);
28+
29+
// The string that appears in the application's title bar.
30+
tcout << _T("ShellAything Arguments Debugging Application\n");
31+
32+
tstring_t arguments_desc;
33+
ReadCommandLineArguments(arguments_desc);
34+
35+
tcout << arguments_desc << "\n";
36+
37+
tcout << "Press any key to continue . . .";
38+
int tmp = ra::console::WaitKeyPress();
39+
tcout << "\n";
40+
41+
return 0;
42+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//{{NO_DEPENDENCIES}}
2+
// Microsoft Visual C++ generated include file.
3+
// Used by showargs.rc
4+
5+
#define IDS_APP_TITLE 103
6+
//
7+
#define IDR_MAINFRAME 128
8+
#define IDD_SHOWARGS_DIALOG 102
9+
#define IDD_ABOUTBOX 103
10+
#define IDM_ABOUT 104
11+
#define IDM_EXIT 105
12+
#define IDI_SHOWARGS 107
13+
#define IDC_SHOWARGS 109
14+
#define ID_EDITCHILD 129
15+
#ifndef IDC_STATIC
16+
#define IDC_STATIC -1
17+
#endif
18+
// Next default values for new objects
19+
//
20+
#ifdef APSTUDIO_INVOKED
21+
#ifndef APSTUDIO_READONLY_SYMBOLS
22+
23+
#define _APS_NO_MFC 130
24+
#define _APS_NEXT_RESOURCE_VALUE 130
25+
#define _APS_NEXT_COMMAND_VALUE 32771
26+
#define _APS_NEXT_CONTROL_VALUE 1000
27+
#define _APS_NEXT_SYMED_VALUE 110
28+
#endif
29+
#endif
45.1 KB
Binary file not shown.
6.59 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#pragma once
2+
3+
// // Including SDKDDKVer.h defines the highest available Windows platform.
4+
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
5+
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
6+
#include <SDKDDKVer.h>

0 commit comments

Comments
 (0)