Comments (3)
@eth-p thanks mate this seems to be a nice solution, I have tried it earlier but my management of args wasn't like this.
Thanks for giving this fn snippet.
from bat.
If you don't mind using a function instead of an alias, this should be able to achieve what you want:
catt() {
local paged=false
local batarg=()
local arg
for arg in "$@"; do
case "$arg" in
--paged) paged=true ;;
*) batarg+=("$arg") ;;
esac
done
if ! "$paged"; then
batarg+=(-pp)
fi
bat "${batarg[@]}"
return $?
}
If you use catt file.txt
, it won't use decorations or the pager. If you use catt file.txt --paged
, it will use the default behavior with the options you set in the config file or through the BAT_*
variables.
from bat.
@niksingh710 Happy to help!
from bat.
Related Issues (20)
- git --help breaks with bat manpager HOT 5
- Wrap=never and bat config not working on macOS HOT 3
- Open $VISUAL / $EDITOR on "v" keypress HOT 2
- how do I change the --highlight-line color from command line? HOT 1
- Gobal --help alias has unintended consequences
- Command line option `--language csharp` will cause an error HOT 1
- Feature Request: Copy to Clipboard Option
- Syntax typo in russian README
- --force-colorization does not work for --help
- bat display markdown wrongly HOT 1
- Set file name as terminal title HOT 1
- Add a --head option that is equivalent to piping the output to head but works with device files HOT 1
- Integrating with google/oss-fuzz for continuous fuzz testing? HOT 1
- Bat failed to work in Powershell or CMD properly HOT 5
- Uninstalling BAT HOT 1
- Bat syntax highlighting doesn't play nicely with backslashes HOT 6
- The system cannot find the path specified. (os error 3) - When attempting to bat a file with Tilde in the path HOT 4
- Highlighting for bioinformatics HOT 4
- support coloresque for css language HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bat.