azihassan / ctrl Goto Github PK
View Code? Open in Web Editor NEWCtrl is a terminal tool that allows you to copy a file THEN paste it elsewhere.
License: MIT License
Ctrl is a terminal tool that allows you to copy a file THEN paste it elsewhere.
License: MIT License
Running pastard after a fresh install results in the following error :
std.exception.ErrnoException@std/stdio.d(421): Cannot open file `/home/hassan/.config/pastard/.clipboard' in mode `w' (No such file or directory)
----------------
??:? @safe void std.exception.bailOut!(std.exception.ErrnoException).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x56524b93cf0d]
??:? @safe shared(core.stdc.stdio._IO_FILE)* std.exception.enforce!(std.exception.ErrnoException).enforce!(shared(core.stdc.stdio._IO_FILE)*).enforce(shared(core.stdc.stdio._IO_FILE)*, lazy const(char)[], immutable(char)[], ulong) [0x56524b96a445]
??:? ref @safe std.stdio.File std.stdio.File.__ctor(immutable(char)[], scope const(char)[]) [0x56524b94c220]
??:? void utils.Clipboard.init() [0x56524b93ebf8]
??:? ref utils.Clipboard utils.Clipboard.__ctor(immutable(char)[]) [0x56524b93eab3]
??:? _Dmain [0x56524b93736e]
Clipboard::init() does attempt to create the file if it does not exist, but it neglects to create the directories leading to it :
void init()
{
if(!path.exists)
{
File(path, "w");
}
}
The code has tests but I have no idea how much coverage there is, it could be a useful metric. Bonus points if it's displayed as a badge on the readme file.
The project has its own custom folder structure. It should be made compatible with dub in order to make it easy to build and get dependencies.
It's still unclear how this should be handled :
The problem with the second approach is that I want to avoid publishing a release when technical or minor changes are pushed to master. Using tags seems to be the way to go, so I'll look into implementing this semi automatic approach :
The current build status badge is a relic from the travis days. Now that the project uses Github actions, it should be updated to reflect this change.
https://docs.github.com/en/actions/managing-workflow-runs/adding-a-workflow-status-badge
A lot of times I copy multiple files from a given directory. Ideally I would like pastard to do this with some sort of glob pattern, but for now, I'd be more comfortable leaving that to other UNIX tools :
ls *.d | ctrlc
Or to avoid breaking changes :
ls *.d | xargs ctrlc
It fails with Invalid cross-device link
. The std.file.rename
documentation explains it :
It is not possible to rename a file across different mount points or drives.
Attempting to copy a file that doesn't exist won't cause an error until it is pasted. Instead, an error should be displayed as soon as ctrlc file_that_does_not_exist
is ran.
The sqlite package displays a bunch of deprecation warnings, it might require an update :
make: Leaving directory '/home/runner/.dub/packages/d2sqlite3-0.19.1/d2sqlite3'
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/database.d(1181,13): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/database.d(1205,13): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/database.d(1235,13): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/database.d(1268,13): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(166,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(179,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(192,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(205,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(220,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(233,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(247,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(278,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(294,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(381,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(416,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(433,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
ctrl 0.0.1+commit.2.g49d6e5f: building configuration "ctrl-test-library"...
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/database.d(1181,13): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/database.d(1205,13): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/database.d(1235,13): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/database.d(1268,13): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(166,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(179,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(192,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(205,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(220,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(233,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(247,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(278,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(294,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(381,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(416,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
../../../.dub/packages/d2sqlite3-0.19.1/d2sqlite3/source/d2sqlite3/statement.d(433,5): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
Pick one from https://choosealicense.com/
It occurred to me last night that there's no way for ctrl to handle folders. It's going to be a whole can of worms since it introduces many questions.
And other fun things to ask myself.
The tool only supports copying files, but it doesn't support moving them.
The current executable file names,ctrlc
and ctrlp
, sound confusing because people would expect to find an executable called pastard
, which is the name of the project. As such, it would make more sense to create a pastard
executable that acts as a front end for the other two. Ideally, I'd like pastard
to contain the main
function and parse input arguments, then call the ctrlc, ctrlp and ctrlx libraries as needed.
I noticed that when pasting files, ctrl
doesn't display anything to confirm whether or not they were pasted successfully. It should at least display the files in question, and if there are errors, notify the user that the relevant files are still present in the clipboard.
Something like this :
$ pwd
/home/ctrl
$ ctrl -C foo bar
$ cd /tmp
$ ls
a
b
bar
$ ctrl -V
Copying /home/ctrl/foo to /tmp/foo [OK]
Copying /home/ctrl/bar to /tmp/bar [Error : bar already exists in this directory]
Warning: /tmp/bar is still present in the clipboard
$ ctrl -l
/home/ctrl/bar
It looks like you pushed some binary files
Current tests consist of shell scripts that display "OK" or "Failed" depending on how the test went. This makes Jenkins integration difficult to accomplish. It would be preferable to rely on a testing framework such as https://github.com/bats-core/bats-core
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.