This is a simple Go application that allows users to search for files in a specified directory. The application run as web application or as a command-line tool.
The user-friendly HTML form where you input your search criteria.
Displays the search results after the user submits the form.
-
Web Interface:
- User-friendly HTML form for input.
- Displays search results on a separate results page.
-
Command-Line Interface (CLI):
- Search for files or directories directly from the terminal.
- Supports exact name matching.
-
Clone the repository:
git clone https://github.com/Vkanhan/filesearcher.git cd filesearcher
-
Running as a Web Application:
go run main.go
Access the application: Open your web browser and go to http://localhost:8080 to access the search form.
-
Running as a Command-Line Tool:
go run main.go -cli
Example CLI usage
Enter the file name to search for: search_result.png Enter the directory to search in: D:// Matches found: D:\Projects\filesearcher\assets\search_result.png
-
Command-Line Flags
-cli: Enables CLI mode.
-filename: (optional) Specifies the file name to search for directly via the command line.
-directory: (optional) Specifies the directory to search in directly via the command line.
Web application
-
Open the application in your web browser at http://localhost:8080.
-
Enter the file name and a valid directory path in the search form.
-
Submit the form to view the search results.
CLI application
-
Run the application with the -cli flag.
-
Enter the file name and directory when prompted.
-
The application will display any matches found.
Ensure that the directory path provided in the search form is an absolute path and has the necessary read permissions.
This project is licensed under the GNU LICENSE. See the LICENSE file for details.