manokara / bencedit Goto Github PK
View Code? Open in Web Editor NEWCommand-line bencode editor
Command-line bencode editor
Primarily a concept for batch mode, this can also be useful for a transform
command in interactive, so it should be on its own module.
A command to remove an inner value from a container.
With no arguments, the root value becomes an empty container if it is a container, and the default value for primitives.
dict
: {}
list
: []
int
: 0
str
: ""
bytes
: b""
Add a value to existing value containers without replacing them. Depending on the type of the container, the arguments would change their meaning:
If it's a dictionary, e.g. insert "newkey" = 5
:
bencedit> insert "" newkey 5
If it's a list, e.g. insert "foobar"
at position 2:
bencedit> insert "" 2 foobar
There could be an alias to this command called append
that adds to the new value to end of the list (if the container is a list). Also, maybe I should add a special case in bencode-rs for .
to be an alias for the root value.
For applying transforms in interactive mode as well. Depends on #4.
Should files be loaded all at once, or only when it's their turn to be processed?
Pretty-printing is configurable for example, but we still lack the actual command to control that, among other things.
bencedit would keep track of the changes done to the structure and jump back and forth to them. An undo/redo function, basically.
undo [n]
: Go back n
(or 1 if not specified) changesredo [n]
: Go forward n
(or 1 if not specified) changeschanges
: List all the changes in the file, prefixed by a numberchange n
: Go to a specific change n
, a number from the previous command.As usual, if you make any changes while in an earlier history, all the late changes will be discarded.
And also save-as
. Files will only be saved if there were changes made in the structure.
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.