2020-01-14 21:29:21 +00:00
|
|
|
//! phetch is a terminal Gopher client designed to help you quickly
|
|
|
|
//! navigate the Gophersphere securely. It includes support for
|
|
|
|
//! browsing via TLS or Tor proxy, but can also be used the old
|
|
|
|
//! fashioned way. The menu-based interface is driven entirely by your
|
|
|
|
//! keyboard, and emphasis has been put on swiftness of navigation.
|
|
|
|
//! Both "jump to link" and incremental search options are available.
|
|
|
|
//!
|
|
|
|
//! We don't use any ncurses-style library for drawing but instead do
|
|
|
|
//! it manually, mainly in `UI`. This is the application class that
|
|
|
|
//! prints to the screen and manages the loaded Gopher "views".
|
|
|
|
//! Meanwhile, the bulk of the menu system, responding to user
|
|
|
|
//! input, and rendering of the colored interface itself takes place
|
|
|
|
//! in the `Menu` view. The two work hand-in-hand.
|
|
|
|
//!
|
|
|
|
//! This crate includes its own Gopher parsing and fetching library,
|
|
|
|
//! which may eventually get extracted. It seems that most existing
|
|
|
|
//! Gopher libraries in Rust allow you to parse menu lines
|
|
|
|
//! individually into items, but phetch needs to know about the links'
|
|
|
|
//! relationships to each other for its navigation/numbering/cursor
|
|
|
|
//! system to work. So phetch parses all the lines in a Menu as a
|
|
|
|
//! whole and knows which link is which.
|
|
|
|
//!
|
|
|
|
//! Finally, a note on the code itself: this is not my first Rust
|
|
|
|
//! program, but you probably wouldn't know that by looking at it!
|
|
|
|
//! Suggestions and improvements are more than welcome.
|
|
|
|
//!
|
|
|
|
|
|
|
|
#![warn(absolute_paths_not_starting_with_crate)]
|
|
|
|
#![warn(explicit_outlives_requirements)]
|
|
|
|
#![warn(unreachable_pub)]
|
|
|
|
#![warn(deprecated_in_future)]
|
|
|
|
#![warn(missing_docs)]
|
2020-01-14 21:08:48 +00:00
|
|
|
#![allow(clippy::while_let_on_iterator)]
|
2020-01-16 03:35:21 +00:00
|
|
|
#![allow(clippy::write_with_newline)]
|
2019-12-22 20:41:45 +00:00
|
|
|
|
|
|
|
#[macro_use]
|
2019-12-23 19:57:40 +00:00
|
|
|
pub mod utils;
|
2020-01-11 00:28:17 +00:00
|
|
|
#[macro_use]
|
2020-01-10 23:59:04 +00:00
|
|
|
pub mod color;
|
2020-01-12 02:15:07 +00:00
|
|
|
pub mod args;
|
2020-01-11 00:28:17 +00:00
|
|
|
pub mod bookmarks;
|
2020-01-09 23:46:55 +00:00
|
|
|
pub mod config;
|
2019-12-23 19:57:40 +00:00
|
|
|
pub mod gopher;
|
2019-12-22 20:41:45 +00:00
|
|
|
pub mod help;
|
|
|
|
pub mod history;
|
|
|
|
pub mod menu;
|
2020-01-09 23:10:45 +00:00
|
|
|
pub mod phetchdir;
|
2019-12-22 20:41:45 +00:00
|
|
|
pub mod text;
|
|
|
|
pub mod ui;
|
2019-12-24 08:29:20 +00:00
|
|
|
|
2020-01-12 03:57:41 +00:00
|
|
|
/// Current version of phetch.
|
2019-12-25 01:22:12 +00:00
|
|
|
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
2020-01-12 03:57:41 +00:00
|
|
|
/// Current OS. Used to check for updates.
|
2020-01-04 22:10:51 +00:00
|
|
|
pub const PLATFORM: &str = env!("PLATFORM");
|
2020-01-12 03:57:41 +00:00
|
|
|
/// Git SHA of current build.
|
2020-01-06 18:18:27 +00:00
|
|
|
pub const GIT_REF: &str = env!("GIT_REF");
|
2020-01-12 03:57:41 +00:00
|
|
|
/// Date when this release was built.
|
2020-01-06 18:18:27 +00:00
|
|
|
pub const BUILD_DATE: &str = env!("BUILD_DATE");
|
2020-01-12 03:57:41 +00:00
|
|
|
/// Where to file issues. We try to catch and display all errors
|
|
|
|
/// nicely, but if we have to crash we will try to show this.
|
2020-01-11 20:55:33 +00:00
|
|
|
pub const BUG_URL: &str = "https://github.com/xvxx/phetch/issues/new";
|
2020-01-06 18:18:27 +00:00
|
|
|
|
2020-01-12 03:57:41 +00:00
|
|
|
/// Whether we compiled with TLS support.
|
2020-01-14 18:13:19 +00:00
|
|
|
#[cfg(feature = "tls")]
|
|
|
|
pub const TLS_SUPPORT: bool = true;
|
|
|
|
#[cfg(not(feature = "tls"))]
|
|
|
|
pub const TLS_SUPPORT: bool = false;
|
|
|
|
|
|
|
|
/// Whether we compiled with Tor support.
|
|
|
|
#[cfg(feature = "tor")]
|
|
|
|
pub const TOR_SUPPORT: bool = true;
|
|
|
|
#[cfg(not(feature = "tor"))]
|
|
|
|
pub const TOR_SUPPORT: bool = false;
|