Skip to content

Commit

Permalink
Integrated ifind help text inside the project in header file plus som…
Browse files Browse the repository at this point in the history
…e minor changes.
  • Loading branch information
dfs-minded committed Jan 17, 2017
1 parent 7321a69 commit cdbca79
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*.exe
*.cache
*.p12
*.cmd
*.opendb

Debug
Release
Expand All @@ -43,3 +45,4 @@ Release

IndexerLog.txt


1 change: 1 addition & 0 deletions IndexerGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Margin="5 5 5 5"
x:Name="searchTextUserInputTextbox"
Style="{DynamicResource TextBoxStyle}"
Text="{Binding SearchString,
UpdateSourceTrigger=PropertyChanged}" />
Expand Down
5 changes: 4 additions & 1 deletion IndexerGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,10 @@ private void InitPart2()
filtersVisibility = Visibility.Visible;
searchDirPath = initialDirPath;

OnPropertyChanged("");
searchTextUserInputTextbox.Focusable = true;
Keyboard.Focus(searchTextUserInputTextbox);

; OnPropertyChanged("");
}

private void PopulateDrives()
Expand Down
1 change: 0 additions & 1 deletion Installer/IndexerInstaller.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ Section "Bare minimum" Section1
file "icon_v3_2.ico"
file "vcomp120.dll"
file "ifind.exe"
file "helpText.txt"
file "BasicRE2Syntax.txt"
file "LICENSE"
file "README"
Expand Down
31 changes: 31 additions & 0 deletions ifind/HelpText.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// This file is the part of the Indexer++ project.
// Copyright (C) 2016 Anna Krykora <[email protected]>. All rights reserved.
// Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

#pragma once

namespace ifind
{

const char* gHelpText = R"(Usage: ifind [path...] [expression]
default path is the current directory; '/' will search the whole system;
expression may consist of tests and actions:
tests (N can be +N or -N or N):
-amin N -atime N
-cmin N -ctime N
-mmin N -mtime N
-iname PATTERN -name PATTERN
-size N[kMG]
'k' for Kilobytes (units of 1024 bytes) (this is default value)
'M' for Megabytes (units of 1048576 bytes)
'G' for Gigabytes (units of 1073741824 bytes)
-type [fd]
actions:
-printf format
-fprint file
-fprintf file format)";

} //namespace ifind
22 changes: 0 additions & 22 deletions ifind/helpText.txt

This file was deleted.

11 changes: 5 additions & 6 deletions ifind/ifind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "UserArgsParser.h"
#include "SearchQueryBuilder.h"

#include "HelpText.h"

using std::wcout;
using std::endl;
using std::wstring;
Expand All @@ -43,12 +45,9 @@ int wmain(int argc, wchar_t* argv[]) {
wstring first_arg = argv[1];

if (first_arg == L"-help" || first_arg == L"--help") {
std::wifstream help_file("helpText.txt");
wstring line;
while (getline(help_file, line))
wcout << line << endl;
return 0;
}
wcout << ifind::gHelpText;
return 0;
}

if (!IsUserAnAdmin()) {
wcout << "Please run console with administrator privileges and try again." << endl;
Expand Down
9 changes: 3 additions & 6 deletions ifind/ifind.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y $(ProjectDir)helpText.txt $(ProjectDir)$(OutDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
Expand All @@ -94,9 +91,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>xcopy /y $(ProjectDir)helpText.txt $(ProjectDir)$(OutDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="ifind.cpp" />
Expand All @@ -110,6 +104,9 @@
<ItemGroup>
<ClInclude Include="UserArgsParser.h" />
</ItemGroup>
<ItemGroup>
<Text Include="HelpText.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
1 change: 0 additions & 1 deletion installerPickingUpScript.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ copy /y CLIInterop\Release\CLIInterop.dll Installer
copy /y "IndexerGUI\bin\Release\Indexer++.exe" "Installer\Indexer++ Beta.exe"
copy /y IndexerGUI\bin\Release\UserSettings.xml Installer
copy /y ifind\Release\ifind.exe Installer
copy /y ifind\Release\helpText.txt Installer
copy /y BasicRE2Syntax.txt Installer


Expand Down

0 comments on commit cdbca79

Please sign in to comment.