fled
lets you organise your files and folders in your favourite editor
fled
enumerates a folder and its files, and generates a text listing.
You can then edit that listing in your favourite editor, and save changes.
fled
then reloads those changes, and prints a shell script that would move
your files and folders around as-per your edits.
You should review that shell script very carefully before running it.
You can install using gem install fled
.
fled
only generates text, it does not perform any operation directly.
The design optimises for making the edits very simple. This means that very small
edits can have large consequences, which makes this a very dangerous tool.
But so is rm
and the rest of the shell anyway...
fled
is only aware of files it scanned. It will not warn for overwrites,
nor use temporary files in those cases, etc.
fled
's editing model is rather complex and fuzzy. While there are some test
cases defined, any help is much appreciated.
You should be scared when using fled
.
Print help text and option list
fled --help
Edit current folder
fled
Edit all files directly in path
folder
fled -a path -d 0
Save default options
fled --options > fled.config.yaml
Edit current folder using options
fled --load fled.config.yaml
Add options to a command (mkdir
, mv
, rm
or rmdir
)
fled | sed 's/^mv/mv -i/'
folder/ :0
file_one :1
folder_two/ :2
file_three :3
Each line of the listing is in the format [indentation] name: uid
- The indentation must consist of only spaces, and is used to indicate the parent folder
- The name must not use colons (
:
). If it is cleared, it is assumed the file/folder is to be deleted The name has a/
appended if it is a directory. - The uid is used by FlEd to recognise the original of the edited line. Do not assume a uid does not change between runs. It is valid only for the current run. Spaces before the uid are only cosmetic.
Add a new line (therefore with no uid):
Original listing | Edited listing |
---|---|
folder/ :0 file_one :1 folder_two/ :2 file_three :3 |
folder/ :0 new_folder folder_two/ :2 |
Generates the script: | |
|
Change the indentation and/or line order to change the parent of a file or folder:
Original listing | Edited listing |
---|---|
folder/ :0 file_one :1 folder_two/ :2 file_three :3 |
folder/ :0 folder_two/ :2 file_one :1 file_three :3 |
Generates the script: | |
|
Moving an item below itself or its children is not recommended, as the listing may not be exhaustive
Edit the name while preserving the uid to rename the item
Original listing | Edited listing |
---|---|
folder/ :0 file_one :1 folder_two/ :2 file_three :3 |
folder_renamed/ :0 file_one :1 folder_two/ :2 file_changed :3 |
Generates the script: | |
|
Clear a name but leave the uid to delete that item
Original listing | Edited listing |
---|---|
folder/ :0 file_one :1 folder_two/ :2 file_three :3 |
folder_renamed/ :0 :1 :2 :3 |
Generates the script: | |
|
If a line (and all child-lines) is removed from the listing, it will have no operation.
Original listing | Edited listing |
---|---|
folder/ :0 file_one :1 folder_two/ :2 file_three :3 |
folder/ :0 |
Generates the script: | |
No operation |
Note that removing a folder without removing its children will move its children:
Original listing | Edited listing |
---|---|
folder/ :0 file_one :1 folder_two/ :2 file_three :3 |
folder/ :0 file_one :1 file_three :3 |
Generates the script: | |
|
If an indent is forgotten:
Original listing | Edited listing |
---|---|
folder/ :0 file_one :1 folder_two/ :2 file_three :3 |
folder/ :0 file_one :1 file_three :3 |
Generates the script: | |
|
Original listing | Edited listing |
---|---|
folder/ :0 file_one :1 folder_two/ :2 file_three :3 |
folder_new/ :0 new_folder/ first :1 second :3 :2 |
Generates the script: | |
|
These sort-of work, but are still rather experimental
folder/ :0
file_one :1
file_two :2
When applying
Original listing | Edited listing |
---|---|
folder/ :0 file_one :1 file_two :2 |
folder/ :0 file_two :1 file_one :2 |
Generates the script: | |
|
Swapping file names may not work in cases where the generated intermediary file exists but was not included in the listing
folder/ :0
sub_folder/ :1
sub_sub_folder/ :2
file.txt :3
When applying
Original listing | Edited listing |
---|---|
folder/ :0 sub_folder/ :1 sub_sub_folder/ :2 file.txt :3 |
sub_sub_folder/ :2 sub_folder/ :1 folder/ :0 file.txt :3 |
Generates the script: | |
|
Version v0.0.4
- New: Sort file listing (if gem naturalsort is installed, it is used too)
- Fix: Non interactive run mode had a bug
Version v0.0.3
- New: Interactive mode with
-u
- New: Error and warning reporting with line numbers
- New: Default configuration file at
~/.fled.yaml
- New: Editor and diff tool are configurable from configuration files
- Meta: Refactoring of code
Version v0.0.2
- Fix: Unreadable directories now ignored
- Fix: Version display and DRYed
- Fix: Moving files under files now moves up to parent folder of destination
- Meta: Travis-CI integration
Version v0.0.1
- First version
Warning: This is a very dangerous tool. The author recommends you do not use it. The author cannot be held responsible in any case.